package com.moyu.ui;

import com.moyu.activity.PanelGame;

import javax.swing.*;
import java.awt.*;

public class LeftLayBottom extends Layout {
    private PanelGame panelGame;
    public LeftLayBottom(int x, int y, int w, int h,PanelGame panelGame) {
        super(x, y, w, h);
        this.panelGame = panelGame;
    }
    public void create(Graphics g){
        this.createWindow(g);
        if (panelGame.getStartGame()) {
            Image levelword = new ImageIcon("resources/images/level/word.png").getImage();
            g.drawImage(levelword, 58, 575, 100, 80, null);
            //具体难度
            String level = Integer.toString((panelGame.getSleeptime() - 100) / 200);
            Image thislevel = new ImageIcon("resources/images/level/" + level + ".png").getImage();
            g.drawImage(thislevel, 158, 577, 90, 75, null);
        } else {
            //按回车开始游戏
            Image startimg = new ImageIcon("resources/images/startent2.png").getImage();
            g.drawImage(startimg, 56, 590, 200, 55, null);
        }
    }
}
